import request from '@/utils/request'

// 查询员工列表
export function listEmployee(query) {
  return request({
    url: '/business/employee/list',
    method: 'get',
    params: query
  })
}

// 查询员工详细
export function getEmployee(id) {
  return request({
    url: '/business/employee/' + id,
    method: 'get'
  })
}

// 新增员工
export function addEmployee(data) {
  return request({
    url: '/business/employee',
    method: 'post',
    data: data
  })
}

// 修改员工
export function updateEmployee(data) {
  return request({
    url: '/business/employee',
    method: 'put',
    data: data
  })
}

// 删除员工
export function delEmployee(id) {
  return request({
    url: '/business/employee/' + id,
    method: 'delete'
  })
}
// 重新生成pdf
export function reCreatPdf(id) {
  return request({
    url: '/business/employee/reCreatPdf/' + id,
    method: 'get'
  })
}

// 员工头像上传
export function uploadAvatar(data) {
  return request({
    url: '/business/employee/avatar',
    method: 'post',
    data: data
  })
}

// 提交分配宿舍的申请
export function allocated(id) {
  return request({
    url: '/business/employee/allocated/' + id,
    method: 'post'
  })
}
// 驳回员工的住宿申请待办状态变为驳回
export function editAllocatedToReject(id) {
  return request({
    url: '/business/employee/editAllocatedToReject/'+id,
    method: 'post',
  })
}
// 查询合同快要到期的员工数据
export function ContractExpirationReminder(query) {
  return request({
    url: '/business/employee/ContractExpirationReminder',
    method: 'get',
    params: query
  })
}
// 退休年龄提醒，男60周岁，女50周岁提醒。
export function retirementReminder(query) {
  return request({
    url: '/business/employee/retirementReminder',
    method: 'get',
    params: query
  })
}